define(["../../js/conf.js"], function(conf){
    var scope = this;
    var vehicleData = window.vehicleData;
    scope.pointGroups = conf.pointGroups;
    var cls = {
        hover: "vm-tr-hover"
    }
    scope.checks = []; //已选点位(供批量处理)
    scope.currentGroup = null;
    scope.showBatchReason = false;
    var topState = scope.topState;

    scope.reasonList = [
        "未按规范拍摄",
        "拍摄质量欠佳",
        "错标点位",
        "其它原因"
    ];

    scope.checkAll = function(){
        if(!scope.currentGroup.list){
            return;
        }
        if(scope.checks.length != scope.currentGroup.list.length){
            scope.checks = $$.map(scope.currentGroup.list, function(p){
                return p.id;
            });
        }else{
            scope.checks = [];
        }
    }
    scope.groupChange = function(i){ //切换大类tab
        scope.currentGroup = scope.pointGroups[i];
        scope.checks = [];
    }
    scope.audit = function(point, audit, reason){
        var id = point.id;
        console.log('audit', id, audit);
        $$.emit("point.audit", id, audit, reason);
    }

    var activeTr = null, isConflict = false;
    scope.routeInit = function(){
        topState.mode = 'audit';
        $$.rootWidget.refresh();
    }
    scope.batchAudit = function(audit, reason){
        topState.showBatchReason = false;
        $$.emit("batch.audit", scope.checks, audit, reason);
    }
    scope.init = function(widget){
        
    };
});
